Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Examples] Remove getInitialProps from with-cookie-auth-fauna #13887

Merged
merged 13 commits into from
Jun 20, 2020
Merged

[Examples] Remove getInitialProps from with-cookie-auth-fauna #13887

merged 13 commits into from
Jun 20, 2020

Conversation

todortotev
Copy link
Contributor

Related to 11014

@ijjk ijjk added the examples Issue was opened via the examples template. label Jun 8, 2020
@ijjk
Copy link
Member

ijjk commented Jun 8, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
buildDuration 12.9s 12.3s -576ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
/ failed reqs 0 0
/ total time (seconds) 2.198 2.189 -0.01
/ avg req/sec 1137.46 1142.16 ⚠️ +4.7
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.416 1.427 ⚠️ +0.01
/error-in-render avg req/sec 1765.23 1752.11 -13.12
Client Bundles (main, webpack, commons)
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..9545.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
index.html gzip 926 B 926 B
link.html gzip 936 B 936 B
withRouter.html gzip 923 B 923 B
Overall change 2.79 kB 2.79 kB

Serverless Mode
General
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
buildDuration 13.7s 13.9s ⚠️ +134ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.js gzip 6.61 kB 6.61 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..9545.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.module.js gzip 5.69 kB 5.69 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary TodorTotev/next.js enhance-with-cookie-auth-fauna Change
_error.js 877 kB 877 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 877 kB 877 kB
link.js 915 kB 915 kB
routerDirect.js 907 kB 907 kB
withRouter.js 907 kB 907 kB
Overall change 4.49 MB 4.49 MB

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@todortotev Let's remove getServerSideProps/getInitialProps entirely, we can't use SSG here because the data depends on the user, but SSR is also not necessary so let's do CSR instead, you can use swr for this. Check the other auth examples for more details.

@todortotev
Copy link
Contributor Author

@lfades apologies I've missed your requested changes. I have completed them now.

@ijjk
Copy link
Member

ijjk commented Jun 16, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
buildDuration 14.3s 13.6s -686ms
nodeModulesSize 65.2 MB 65.2 MB
Page Load Tests Overall increase ✓
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
/ failed reqs 0 0
/ total time (seconds) 2.411 2.402 -0.01
/ avg req/sec 1037.05 1040.71 ⚠️ +3.66
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.646 1.593 -0.05
/error-in-render avg req/sec 1518.79 1569.49 ⚠️ +50.7
Client Bundles (main, webpack, commons)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
index.html gzip 956 B 956 B
link.html gzip 963 B 963 B
withRouter.html gzip 949 B 949 B
Overall change 2.87 kB 2.87 kB

Serverless Mode
General
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
buildDuration 14.5s 14.9s ⚠️ +363ms
nodeModulesSize 65.2 MB 65.2 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..0538.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

@todortotev todortotev requested a review from lfades June 16, 2020 13:45
@todortotev todortotev requested a review from lfades June 19, 2020 07:50
@todortotev
Copy link
Contributor Author

@lfades done

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some changes and it now looks good to me, thank you @todortotev !

@ijjk
Copy link
Member

ijjk commented Jun 19, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
buildDuration 12.2s 12.2s -17ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
/ failed reqs 0 0
/ total time (seconds) 2.052 2.034 -0.02
/ avg req/sec 1218.3 1229.19 ⚠️ +10.89
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.231 1.24 ⚠️ +0.01
/error-in-render avg req/sec 2030.52 2015.32 -15.2
Client Bundles (main, webpack, commons)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..4dd5.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
index.html gzip 953 B 953 B
link.html gzip 960 B 960 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
buildDuration 12.8s 13s ⚠️ +187ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..4dd5.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary todortotev/next.js enhance-with-cookie-auth-fauna Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: ce86777

@lfades lfades merged commit 5bed435 into vercel:canary Jun 20, 2020
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
…#13887)

* Remove getInitialProps

* added swr

* Update examples/with-cookie-auth-fauna/pages/profile.js

Co-authored-by: Luis Alvarez D. <[email protected]>

* Update examples/with-cookie-auth-fauna/pages/profile.js

Co-authored-by: Luis Alvarez D. <[email protected]>

* no longer needed

* new .env support

* redirect if not found

* always use latest next version

* no longer needed

* Updated readme

* Updated profile page

* Fixed readme and added deploy button

Co-authored-by: Luis Alvarez D. <[email protected]>
@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants